package com.show.web.thermodynamic;

import com.show.common.Result;
import com.show.dto.population.Population;
import com.show.dto.unit.Unit;
import com.show.service.population.PopulationService;
import com.show.service.unit.UnitService;
import com.show.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 部件展示控制器
 *
 * @author liukai
 */
@RestController
@RequestMapping(value = "thermodynamic")
public class ThermodynamicDataController {


    private UnitService unitService;

    private PopulationService populationService;

    @Autowired
    public ThermodynamicDataController(UnitService unitService,PopulationService populationService) {
        this.unitService = unitService;
        this.populationService = populationService;
    }


    /**
     * 热力图展示
     *
     * @author 姜文
     */
    @PostMapping(value = "getThermodynamic")
    public Result getThermodynamic() {
        List<Population> populationList = populationService.getPopulation();
        return ResultUtil.success("热力图展示", populationList);
    }

    /**
     * 基站热力图展示
     *
     * @author 姜文
     */
    @PostMapping(value = "getThermodynamicForJZ")
    public Result getThermodynamicForJZ(String id) {
        List<Population> populationList = populationService.getPopulationForJZ(id);
        return ResultUtil.success("热力图展示", populationList);
    }

}
